package com.caiyouxi.msg.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.msg.model.Messages;
import com.caiyouxi.msg.service.MessagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("messages")
public class MessagesController {
    @Autowired
    private MessagesService service;

    @RequestMapping("delete_messages")
    public ResData delete_messages(@RequestBody Messages bean){
        return service.delete_messages(bean);
    }


    @RequestMapping("insert_message")
    public ResData insert_message(@RequestBody Messages bean){
        return service.insert_message(bean);
    }

    @RequestMapping("select_single_message")
    public ResData select_single_message(@RequestBody Messages bean){
        return service.select_single_message(bean);
    }

    @RequestMapping("update_message")
    public ResData update_message(@RequestBody Messages bean){
        return service.update_messagee(bean);
    }

    @RequestMapping("select_all")
    public  ResData select_all(@RequestBody Messages bean){
        return service.get_all_message(bean);
    }
}
